Filter hook 'customize_sanitize_{$this->id}'

in WP Core File wp-includes/customize/class-wp-customize-nav-menu-setting.php at line 444

View Source

customize_sanitize_{$this->id}

Filter Hook
Description
Sanitize an input. Note that parent::sanitize() erroneously does wp_unslash() on $value, but we remove that in this override. Otherwise the sanitized value.

Hook Information

File Location wp-includes/customize/class-wp-customize-nav-menu-setting.php View on GitHub
Hook Type Filter
Line Number 444

Hook Parameters

Type Name Description
array $value The menu value to sanitize.

Usage Examples

Basic Usage
<?php
// Hook into customize_sanitize_{$this->id}
add_filter('customize_sanitize_{$this->id}', 'my_custom_filter', 10, 1);

function my_custom_filter($value) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/customize/class-wp-customize-nav-menu-setting.php:444 - How this hook is used in WordPress core
<?php
 439  		if ( '' === $value['name'] ) {
 440  			$value['name'] = _x( '(unnamed)', 'Missing menu name.' );
 441  		}
 442  
 443  		/** This filter is documented in wp-includes/class-wp-customize-setting.php */
 444  		return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
 445  	}
 446  
 447  	/**
 448  	 * Storage for data to be sent back to client in customize_save_response filter.
 449  	 *

PHP Documentation

<?php
/**
	 * Sanitize an input.
	 *
	 * Note that parent::sanitize() erroneously does wp_unslash() on $value, but
	 * we remove that in this override.
	 *
	 * @since 4.3.0
	 *
	 * @param array $value The menu value to sanitize.
	 * @return array|false|null Null if an input isn't valid. False if it is marked for deletion.
	 *                          Otherwise the sanitized value.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/customize/class-wp-customize-nav-menu-setting.php
Related Hooks

Related hooks will be displayed here in future updates.